<!-- 注册 -->
<div class="modal fade" id="reg" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>

<h4 class="modal-title" id="myModalLabel">请填写用户信息</h4>
</div>
<div class="modal-body">
<form name="fm"  method="post" action="doUserReg.php"  onsubmit="return  check()" class="form-horizontal">


 
<?php
// show.php页面传来的登录链接，需要带着  vid参数，以便登陆成功后直接返回视频内容页
?>
<div class="form-group">
	<label for="exampleInputUserName1" class="col-md-2 contro-label">用户名</label>
	<div class="col-md-10">
		<input type="text" name="username" class="form-control" id="exampleInputUsrName1" placeholder="姓名" required>
	</div>	
	</div>

	<div class="form-group">
	<label for="exampleInputPassword1" class="col-md-2 contro-label">密码</label>
	<div class="col-md-10">
		<input type="password" name="password" class="form-control" id="exampleInputPassword1" placeholder="密码" required>
	</div>	
	</div>

	<div class="form-group">
	<label for="exampleInputAge1" class="col-md-2 contro-label">年龄</label>
	<div class="col-md-10">
		<input type="number" name="age" class="form-control" id="exampleInputAge1" placeholder="年龄" required>
	</div>	
	</div>	



	<div class="form-group">
	<label class="col-md-2 contro-label">性别</label>
	<div class="col-md-10">
		<label class="raddio-inline">
			<input type="radio" name="sex" value="0" checked>男
		</label>
		<label class="radio-online">
			<input type="radio" name="sex" value="1">女
		</label>
	</div>	
	</div>

	<div class="form-group">
	<label class="col-md-2 contro-label">爱好</label>
	<div class="col-md-10">
		<label class="checkbox-inline">
			<input type="checkbox" name="hobby[]" value="旅游" checked>旅游</label>
			<label class="checkbox-inline">
			<input type="checkbox" name="hobby[]" value="登山" checked>登山
			</label>
			<label class="checkbox-inline">		
			<input type="checkbox" name="hobby[]" value="健身" >健身
			</label>
			<label class="checkbox-inline">
			<input type="checkbox" name="hobby[]" value="上网" >上网
			</label>
			<label class="checkbox-inline">
			<input type="checkbox" name="hobby[]" value="游泳" >游泳
			</label>
	</div>	
	</div>



	<div class="form-group">
	<label class="col-md-2 contro-label">学历</label>
	<div class="col-md-10">
		<select name="degree" >
			<option value="0">请选择</option>
			<option value="1">高中</option>
			<option value="2">大学</option>
			<option value="3">研究生</option>
			<option value="4">博士生</option>
		</select>
	</div>	
	</div>

	<div class="form-group">
	<label for="exampleInputTextarea1" class="col-md-2 contro-label">自我介绍</label>
	<div class="col-md-10">
		<textarea class="from-control" rows="3" id="exampleInputTextarea1" placeholder="自我介绍" name="intro"></textarea>
	</div>	
	</div>

	<div class="form-group">
	<label for="exampleInputFile" class="col-md-2 contro-label">头像</label>
	<div class="col-md-10">
		<input type="file" name="pic" id="exampleInputFile" required>
	</div>	
	</div>

	<div class="form-group">
	
	<div class="col-sm-offset=2 col-sm-10">
		<input type="submit" class="btn btn-success" value="提交">
		<input type="reset" class="btn btn-danger" value="重置">	
	</div>	
	</div>
	</form>
</div>
</div>
</div>
</div>



<!-- 用户登录 -->
<div class="modal fade" id="login" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">请填写普通用户登录信息</h4>
</div>
<div class="modal-body">
<form name="fm"  method="post" action="doLogin.php"  onsubmit="return  check()" class="form-horizontal">


 
<?php
// show.php页面传来的登录链接，需要带着  vid参数，以便登陆成功后直接返回视频内容页
?>
<input type="hidden" name="mid" id="musicid" >
<div class="form-group">
<label for="exampleInputUserName1" class="col-md-2 control-label">用户名</label>
<div class="col-md-4">
<input  type="text"  name="username"  class="form-control"  id="exampleInputUserName1"
placeholder="姓名" required>
</div>
<div class="col-md-6">
</div>
</div>
<div class="form-group">
<label for="exampleInputPassword1" class="col-md-2 control-label">密码</label>
<div class="col-md-4">
<input  type="password"  name="pswd" class="form-control"  id="exampleInputPassword1"
placeholder="密码" required>
</div>
<div class="col-md-6">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<input type="submit" class="btn btn-default" value="登录">
<input type="reset" class="btn btn-default" value="重置">
</div>
</div>
<?php
if(isset($_GET["msg"])){
echo'<h1 style="color:red;">'.$_GET["msg"]."</h1>";
}

?>
<?php
if(isset($_GET["msg9"])){
echo'<h1 style="color:red;">'.$_GET["msg9"]."</h1>";
}
?>
</form>
</div>
<div class="modal-footer">
<button   type="button"   class="btn   btn-default"   onclick="location.replace('index.php')"
data-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>


<!-- 修改密码 -->
<div class="modal fade" id="changePassword" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">修改个人密码</h4>
</div>
<div class="modal-body">
<form name="fm"  method="post"   action="doChangePassword.php"  onsubmit="return check()" class="form-horizontal">
<div class="form-group">
<label for="exampleInputPassword1" class="col-md-4 control-label">原密码</label>
<div class="col-md-4">
<input  type="password"   name="old"  class="form-control"   id="exampleInputPassword1"
placeholder="原密码" required>
</div>
<div class="col-md-4">
</div>
</div>
<div class="form-group">
<label for="exampleInputPassword1" class="col-md-4 control-label">新密码</label>
<div class="col-md-4">
<input  type="password" name="new1"  class="form-control"  id="exampleInputPassword1"
placeholder="新密码" required>
</div>
<div class="col-md-4">
</div>
</div>
<div class="form-group">
<label  for="exampleInputPassword1"  class="col-md-4  control-label">确认新 密码
</label>
<div class="col-md-4">
<input  type="password" name="new2"  class="form-control"  id="exampleInputPassword1"
placeholder="确认新密码" required>
</div>
<div class="col-md-4">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<input type="submit" class="btn btn-default" value="修改">
<input type="reset" class="btn btn-default" value="重置">
</div>
</div>
<?php
if(isset($_GET["msg3"])){
echo'<h1 style="color:red;">'.$_GET["msg3"]."</h1>";
}
?>
<?php
if(isset($_GET["msg4"])){
echo'<h1 style="color:red;">'.$_GET["msg4"]."</h1>";
}
?>
<?php
if(isset($_GET["msg5"])){
echo'<h1 style="color:red;">'.$_GET["msg5"]."</h1>";
}
?>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" onclick="location.replace('index.php')" data-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>




<!-- 修改个人信息 -->
	 <?php 
	include_once('./system/dbConn.php');
	//连接数据
	
	session_start();
	$u=$_SESSION["user"];
	$sql0="select * from users where uname='$u'";
	$rs=mysql_query($sql0);
	$row=mysql_fetch_assoc($rs);


	 //var_dump($row);

	 $uname=$row['uname'];
	 $gender=$row['gender'];
	 $birthdate=$row['birthdate'];
	 $hobby=$row['hobby'];
	 $degree=$row['degree'];
	 $intro=$row['intro'];
	 $pic=UserPhotoPath.$row['pic'];
	 //将查询结果显示在表单中
	  ?>
	
	<div class="modal fade" id="changeInfor" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
	<div class="modal-dialog" role="document">
	<div class="modal-content">
	<div class="modal-header">
	<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>



	<h4 class="modal-title" id="myModalLabel">修改个人信息</h4>
	</div>
	<div class="modal-body">
	<form name="fm" enctype="multipart/form-data" method="post"   action="doChangeInfor.php"  onsubmit="return check()" class="form-horizontal">

	 

	<div class="form-group">
        <label for="username" class="col-md-2 contro-label">用户名</label>
        <div class="col-md-10">
            <input type="text" name="uname" class="form-control" id="username" readonly="readonly" value=<?php echo $uname; ?>>
        </div>  
        </div>

        
        <div class="form-group">
           <label class="col-md-2 contro-label">性别</label>
           <div class="col-md-10">
           <label class="radio-inline">
               <input type="radio" name="gender" value="0" <?php if(!$gender) echo 'checked'; ?>>男 </label>
            <label class="radio-inline"><input type="radio" name="gender" value="1" <?php if($gender) echo 'checked'; ?>>女</label>
       
           </div>  
           </div>
   
         <div class="form-group">
            <label class="col-md-2 contro-label">生日</label>
            <div class="col-md-10">
            <input type="date" name="birthdate" class="form-control" value=<?php echo "$birthdate"; ?> >
            </div>  
            </div>

            <div class="form-group">
               <label class="col-md-2 contro-label">爱好</label>
               <div class="col-md-10">
               <label class="checkbox-inline">
                <input type="checkbox" name="hobby[]" value="旅游" <?php if(strstr($hobby,'旅游')) echo 'checked'; ?>>旅游</label>
                <label class="checkbox-inline">
                <input type="checkbox" name="hobby[]" value="登山" <?php if(strstr($hobby,'登山')) echo 'checked' ;?>>登山</label>
                <label class="checkbox-inline">
                <input type="checkbox" name="hobby[]" value="健身" <?php if(strstr($hobby,'健身')) echo 'checked' ;?>>健身</label>
                <label class="checkbox-inline">
                <input type="checkbox" name="hobby[]" value="上网" <?php if(strstr($hobby,'上网')) echo 'checked'; ?>>上网</label>
                <label class="checkbox-inline">
                <input type="checkbox" name="hobby[]" value="游泳" <?php if(strstr($hobby,'游泳')) echo 'checked' ;?>>游泳</label>
                   </div>  
                   </div>



        
        <div class="form-group">
           <label class="col-md-2 contro-label">学历</label>
           <div class="col-md-10">
            <select name="degree" >
                <option value="0">请选择</option>
                <option value="1" <?php if($degree=='1') echo 'selected'; ?>>高中</option>
                <option value="2" <?php if($degree=='2') echo 'selected'; ?>>大学</option>
                <option value="3" <?php if($degree=='3') echo 'selected'; ?>>研究生</option>
                <option value="4" <?php if($degree=='4') echo 'selected'; ?>>博士生</option>
            </select>
      </div>  
      </div>

   <div class="form-group">
      <label class="col-md-2 contro-label">自我介绍</label>
      <div class="col-md-10">
   
           <textarea class="form-control" rows="3" id="exampleInputTextareal" placeholder="自我介绍" name="intro"><?php echo $intro; ?></textarea>
     </div>  
     </div>

    <div class="form-group">
       <label for="exampleInputFile" class="col-md-2 contro-label">头像</label>
       <div class="col-md-10">
       <input type="file" name="pic" id="exampleInputFile" required="">
   		</div>
	</div>

	<div class="form-group">
	   <label for="exampleInputFile" class="col-md-2 contro-label">原头像</label>
	   <div class="col-md-10">
        <img class="img-circle" src="<?php echo $pic; ?>" width=60 height=60 alt="无头像" >
        </div>  
        </div>
       
   
        
   <div class="form-group">
   <div class="col-sm-offset-2 col-sm-10">

    <input type="submit" class="btn btn-default" value="更新">
    <input type="reset" class="btn btn-default" value="重置"> 
         
   </div>  
   </div>
   </form>
	<?php
	if(isset($_GET["msg6"])){
	echo'<h1 style="color:red;">'.$_GET["msg6"]."</h1>";
	}
	?>
	<?php
	if(isset($_GET["msg7"])){
	echo'<h1 style="color:red;">'.$_GET["msg7"]."</h1>";
	}
	?>
	
		
		</div>
		<div class="modal-footer">
		<button type="button" class="btn btn-default" onclick="location.replace('index.php')" data-dismiss="modal">关闭</button>
		</div>
		</div>
		</div>
		</div>

	




		 
		
